<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: hpp <1959919036@qq.com>
// +----------------------------------------------------------------------

Route::get('think', function () {
    return 'hello,ThinkPHP5!';
});

// 前台路由
Route::get('', 'index/index');
Route::get('index', 'index/index');


// 后台路由
// 登录页
Route::get('admin/login','admin/login/login');
Route::post('admin/do','admin/login/doLogin');
Route::get('admin/logout','admin/login/logout');
// 验证码
Route::get('admin/verify','admin/login/verify');

// wx_login
Route::get('wxlogin','admin/login/wxlogin');
Route::get('wx','admin/login/wx');

Route::group('admin',function(){
	// 首页欢迎页
	Route::get('welcome','index/welcome');
// 首页入口
	Route::get('','index/index');
	Route::get('/','index/index');
	Route::get('home','index/index');


	Route::get('user','user/index');
	// 系统菜单
	Route::resource('sysmenu','admin/sysMenu');
	Route::get('status/:id/:status','sysMenu/updateStatus');
	// 数据备份
	Route::get('backup','data/index');
	Route::get('optimize','data/optimizeAndRepair');
	Route::rule('export','data/backup');

	// 管理员管理
	Route::resource('manager','admin/admin');
	Route::get('adminstatus/:id/:status','admin/updateStatus');
	Route::get('deleteadmin','admin/deletes');
	Route::post('modify/role','admin/modifyRole');

	// 角色管理
	Route::resource('role','admin/role');
	Route::get('deleterole','role/deletes');
	Route::get('role/permission/:role_id','role/permission');
	Route::post('role/permission/store','role/store');

	// 权限管理
	Route::resource('permission','admin/permission');
	Route::get('deletepermission','permission/deletes');

	// 登录日志
	Route::get('loginLog','loginLog/index');

})->prefix('admin/')->middleware('check');
